{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票结果 - {{ question.question_text }}</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
    <style>
        body {
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
            margin: 0;
            padding: 0;
        }
        
        .container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 0 1rem;
        }
        
        .result-card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            padding: 2rem;
            margin-bottom: 2rem;
        }
        
        .result-title {
            color: #2c3e50;
            font-size: 1.8rem;
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #eee;
        }
        
        .result-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .result-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 0;
            border-bottom: 1px solid #eee;
        }
        
        .result-item:last-child {
            border-bottom: none;
        }
        
        .choice-text {
            flex: 1;
            font-size: 1.1rem;
        }
        
        .vote-count {
            background: #3498db;
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.9rem;
            min-width: 60px;
            text-align: center;
        }
        
        .navigation {
            display: flex;
            justify-content: space-between;
            margin-top: 2rem;
        }
        
        .nav-button {
            display: inline-block;
            padding: 0.8rem 1.5rem;
            border-radius: 5px;
            text-decoration: none;
            transition: all 0.3s;
        }
        
        .home-button {
            background: #2c3e50;
            color: white;
        }
        
        .home-button:hover {
            background: #1a252f;
        }
        
        .back-button {
            background: #e74c3c;
            color: white;
        }
        
        .back-button:hover {
            background: #c0392b;
        }
        
        @media (max-width: 600px) {
            .container {
                padding: 0 0.5rem;
            }
            
            .result-card {
                padding: 1rem;
            }
            
            .result-title {
                font-size: 1.5rem;
            }
            
            .navigation {
                flex-direction: column;
                gap: 1rem;
            }
            
            .nav-button {
                width: 100%;
                text-align: center;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="result-card">
            <h1 class="result-title">{{ question.question_text }}</h1>
            
            <ul class="result-list">
                {% for choice in question.choice_set.all %}
                <li class="result-item">
                    <span class="choice-text">{{ choice.choice_text }}</span>
                    <span class="vote-count">{{ choice.votes }} vote{{ choice.votes|pluralize }}</span>
                </li>
                {% endfor %}
            </ul>
            
            <div class="navigation">
                <a href="{% url 'polls:index' %}" class="nav-button home-button">返回首页</a>
                <a href="{% url 'polls:detail' question.id %}" class="nav-button back-button">重新投票</a>
            </div>
        </div>
    </div>
</body>
</html>